package com.taoyun.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author lkxicy
 * @since 2020-09-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Group implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "GroupId", type = IdType.AUTO)
    private Integer GId;

    @TableField("GroupId")
    private Integer GroupId;

    @TableField("U_Id")
    private Integer uId;

    @TableField("GroupName")
    private String GroupName;

    @TableField("Up_Permission")
    private String upPermission;

    @TableField("DL_Permission")
    private String dlPermission;

    @TableField("L_Permission")
    private String lPermission;

    @TableField("Re_Permission")
    private String rePermission;

    @TableField("D_Permission")
    private String dPermission;

    @TableField("M_Permission")
    private String mPermission;

    @TableField("U_Permission")
    private String uPermission;  //群组的身份(群主，群成员)

    public Group(){}

    //初始化群主信息，用于管理员创建群组时
    public Group(String GroupName,Integer AdminId,Integer GroupId){
        this.GroupId=GroupId;
        this.uId=AdminId;
        this.GroupName=GroupName;
        this.upPermission="1";
        this.dlPermission="1";
        this.lPermission="1";
        this.rePermission="1";
        this.dPermission="1";
        this.mPermission="1";
        this.uPermission="群主";
    }

    public Group(Integer uId,Integer GroupId,String GroupName){ //初始化员工
        this.GroupId=GroupId;
        this.uId=uId;
        this.GroupName=GroupName;
        this.upPermission="1";
        this.dlPermission="1";
        this.lPermission="1";
        this.rePermission="0";
        this.dPermission="0";
        this.mPermission="0";
        this.uPermission="群成员";
    }
}
